/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.member;

import com.enation.app.javashop.client.member.MemberCollectionGoodsClient;
import com.enation.app.javashop.core.client.fallback.member.MemberCollectionGoodsFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 会员收藏商品feign实现
 *
 * @author zh
 * @version v7.0
 * @date 18/7/31 下午5:08
 * @since v7.0
 */
@FeignClient(name = "member-service", fallbackFactory= MemberCollectionGoodsFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface MemberCollectionGoodsFeignImpl extends MemberCollectionGoodsClient {

    /**
     * 获取某商品的收藏数量
     *
     * @param goodsId
     * @return
     */
    @Override
    @RequestMapping(value = "/client/members/collection-goods/{goods_id}", method = RequestMethod.GET)
    Integer getGoodsCollectCount(@PathVariable("goods_id") Long goodsId);

    /**
     * 更新收藏的商品名称
     * @param goodsId
     * @param goodsName
     */
    @Override
    @RequestMapping(value = "/client/members/collection-goods/{goods_id}/update-goods-name", method = RequestMethod.POST)
    void updateGoodsName(@PathVariable("goods_id")Long goodsId,@RequestParam("goods_name") String goodsName);
}
